import React from 'react';
import { Navigate, Outlet } from 'react-router-dom';

const userAuth = () => {
  const user = { loginStatus: false };
  return user && user.loginStatus;
}

const PrivateRoute = () => {
  const isLogin = userAuth();
  return isLogin? <Outlet/> : <Navigate to="/login" />;
}

export default PrivateRoute;